// Copyright (C) Microsoft Corporation. All rights reserved.

using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using System.Security.Permissions;

namespace Microsoft.VSPowerToys.VSCmdShell
{
    /// <summary>
    /// This exception should be raised by shell host implementations in case of an error.
    /// </summary>
    [Serializable]
    public class ShellHostException : Exception
    {
        #region Constructors

        /// <summary>
        /// Default constructor (created for compatilibity)
        /// </summary>
        public ShellHostException()
            : base()
        {
        }

        /// <summary>
        /// Constructor that should be used to create instances of this expection in the application
        /// </summary>
        /// <param name="msg">Message to exception handler</param>
        public ShellHostException(string msg)
            : base(msg)
        {
        }

        /// <summary>
        /// Constructor created for compatibility
        /// </summary>
        /// <param name="msg"></param>
        /// <param name="inner"></param>
        public ShellHostException(string msg, Exception inner)
            : base(msg, inner)
        {

        }
        /// <summary>
        /// Constructor created for compatibility
        /// </summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
        protected ShellHostException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
        }

        #endregion

        [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
        public override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            base.GetObjectData(info, context);
        }
    }
}
